SBYTES

Syntax: SBYTES device_file,start,length         
    or: SBYTES device_file,start[,length[,data[,extra[,type]]]
        (Minerva v1.80+)
    or: SBYTES [device_]file,start,length
        (Toolkit II)
    or: SBYTES #channel,start,length
        (SMS only)
Location: QL ROM, Toolkit II

The command SBYTES allows you to save length number of bytes from the QL's memory, starting from the specified start address. The area of memory is saved to the specified file which must include the name of the device to be used, unless Toolkit II is present, in which case the default data device is supported.

The Toolkit II variant will also provide you with the option of overwriting the file if it already exists.

Example:
SBYTES flp1_Example_scr,SCREEN,32768

MINERVA NOTES:
On Minerva v1.80 (or later) the commands SBYTES and SEXEC have practically become interchangeable, as both support exactly the same parameters. All of the parameters except for the start address and device_file where the data is to be stored, are optional and will default to 0 if not specified.

These additional parameters have the following uses:

extra
This sets the value which is normally returned with FXTRA.

type
This allows you to set two file attributes:
(a) the file type - this is normally 0 for data,
    or 1 for executable programs.
    This is calculated by PRINT type && 255.
(b) the file access key - it is generally used
    by Toolkits to store various file attributes
    (such as whether a file is read-only).
    This is calculated by PRINT type DIV 256.

The only problem with using this extended version of SBYTES instead of using SEXEC is that you must remember to specify a file type of 1 if the file is later to be EXECuted (as this defaults to 0 in the case of SBYTES!).

SMS NOTE:
The fourth variant of the command allows you to save the bytes to an existing channel which is already OPEN to a file, thus allowing you to work more efficiently.

CROSS-REFERENCE:
SBYTES_O and SEXEC are very similar. 
DATA_USE allows you to alter the current default data device. 
LBYTES allows you to load in a block of code which has been saved with SBYTES or SEXEC.
